#ifndef LCD03_H_
#define LCD03_H_

// MACRO LCD03 - passer le buffer et le pointeur initialises pour travailler avec le LCD
#define LCD03_CURSOR_HOME()			dataPtr=0; sprintf(lcdData,"%c%c", 1, 0); I2C1_START_TX();
#define LCD03_SET_CURSOR(lpos)		dataPtr=0; sprintf(lcdData,"%c%c%c", 2, pos, 0); I2C1_START_TX();  // pos = 80 max
#define LCD03_SET_CURSORXY(l, c)	dataPtr=0; sprintf(lcdData,"%c%c%c%c", 3, l, c, 0); I2C1_START_TX();
#define LCD03_HIDE_CURSOR()			dataPtr=0; sprintf(lcdData,"%c%c", 4, 0); I2C1_START_TX();
#define LCD03_UNDERLINE_CURSOR()	dataPtr=0; sprintf(lcdData,"%c%c", 5, 0); I2C1_START_TX();
#define LCD03_BLINK_CURSOR()		dataPtr=0; sprintf(lcdData,"%c%c", 6, 0); I2C1_START_TX();
#define LCD03_BACKSPACE()			dataPtr=0; sprintf(lcdData,"%c%c", 8, 0); I2C1_START_TX();
#define LCD03_HTAB()				dataPtr=0; sprintf(lcdData,"%c%c", 9, 0); I2C1_START_TX();
#define LCD03_LINE_FEED()			dataPtr=0; sprintf(lcdData,"%c%c", 10, 0); I2C1_START_TX();
#define LCD03_VTAB()				dataPtr=0; sprintf(lcdData,"%c%c", 11, 0); I2C1_START_TX();
#define LCD03_CLEAR_HOME()			dataPtr=0; sprintf(lcdData,"%c%c", 12, 0); I2C1_START_TX();
#define LCD03_CR()					dataPtr=0; sprintf(lcdData,"%c%c", 13, 0); I2C1_START_TX();
#define LCD03_CLEAR_COL()			dataPtr=0; sprintf(lcdData,"%c%c", 17, 0); I2C1_START_TX();
#define LCD03_TAB_SET(tab)			dataPtr=0; sprintf(lcdData,"%c%c%c", 18, tab, 0); I2C1_START_TX();
#define LCD03_BACK_ON()				dataPtr=0; sprintf(lcdData,"%c%c", 19, 0); I2C1_START_TX();
#define LCD03_BACK_OFF()			dataPtr=0; sprintf(lcdData,"%c%c", 20, 0); I2C1_START_TX();
#define LCD03_STARTMSG_OFF()		dataPtr=0; sprintf(lcdData,"%c%c", 21, 0); I2C1_START_TX();
#define LCD03_STARTMSG_ON()			dataPtr=0; sprintf(lcdData,"%c%c", 22, 0); I2C1_START_TX();
#define LCD03_NEW_ADDRESS(addr)	dataPtr=0; sprintf(lcdData,"%c%c", 25, addr, 0); I2C1_START_TX();

#define LCD03_MSG(msg)			dataPtr=0; sprintf(lcdData, "%s", msg); I2C1_START_TX(); // msg est nul terminated

char *lcdData;
int dataPtr;
int lcd03Address; // LCD03  = 0xc6 defaut usine;
int i2cStatus;

#endif /* LCD03_H_ */
